//安置页面
function toSettleTabs() {
    var row = grid.getSelected();
    $.ajax({
        url: "/azbj/inmates/getHasDate?priNum=" + row.priNum,
        type: "GET",
        async: false,
        success: function (result) {
            if (result == "no") {
                mini.alert("请补录该服刑人员的刑期起止日");
            } else {
                mini.open({
                    url: "/azbj/bjdxInfo/qbrygl/toAllTab/view?priNum=" + row.priNum+"&type="+1,
                    title: "安置",
                    width: "68%",
                    height: "80%",
                    allowDrag: true,
                    allowResize: false,
                    showCloseButton: true,
                    onload: function () {
                    },
                    ondestroy: function (action) {
                        grid.reload();
                    }
                });
            }
        }
    })
}

//全部人员管理--查看
function toViewHjqc() {
    var row = grid.getSelected();
    mini.open({
        url: "/azbj/bjdxInfo/hjqc/toViewTabs/view?priNum=" + row.priNum,
        title: "查看",
        width: "60%",
        height: "80%",
        allowDrag: true,
        allowResize: false,
        showCloseButton: true,
        onload: function () {
        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

// 移出基地操作
function toMove() {
    var row = grid.getSelected();
    if (row) {
        mini.open({
            url: "/azbj/azbjgl/azgzgl/moveJd?priNum=" + row.priNum,
            title: "移出基地", width: '480px', height: '180px',
            allowResize: false,
            onload: function () {
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    } else {
        alert("请至少选择一条数据！");
    }
}

// 批量移出基地
function plyc() {
    var rows = grid.getSelecteds();
    if (rows.length <= 0) {
        mini.alert("请勾选要发起核查的户籍完整的条目");
        return;
    }

    var prinums = [];
    var i = 0;
    for (j = 0, len = rows.length; j < len; j++) {
        prinums[i] = rows[j].priNum;
        i++;
    }

    mini.confirm("您一共选择:" + rows.length + "条数据",
        "确定移出基地？",
        function aaa(action) {
            if (action == "ok") {
                if (prinums.length <= 0) {

                } else {
                    commonEdit("/azbj/azbjgl/azgzgl/plview?prinums=" + prinums
                        , "批量移出基地", null, 480, 180, true, true, true, callback);

                    function callback() {
                        grid.reload();
                    }
                }
            }
        });
}

function toSettleTabsAgain(t) {
    var rows = grid.getSelecteds();
    if(rows.length>1){
        mini.alert("请勾选一条数据再查看");
        return;
    }else{
        var row = grid.getSelected();
        if (row) {
            mini.open({
                url: "/azbj/bjdxInfo/qbrygl/toAllTab/view?priNum=" + row.priNum + "&type=" + 1,
                title: "安置", width: '68%', height: '80%',
                onload: function () {
                },
                ondestroy: function (action) {
                    grid.reload();
                }
            });
        }else{
            alert("请至少选择一条数据！");
        }
    }
}